#include<stdio.h>
#include<string.h>
#include<unistd.h>
#define MUN 100

int main()
{
  char bar[MUN+1];
  const char* s = "|/-\\";
  memset(bar,'\0',sizeof(bar));
  int i =0;
  while(i<=100)
  {
    printf("[%-100s][%3d%%][%c]\r",bar,i,s[i%4]);
    fflush(stdout);

    bar[i++] = '#';
    usleep(50000);
  }
  printf("\n");
  return 0;


}
